﻿using System.Collections.Generic;

namespace Tool
{
    /// <summary>
    /// Dtree 树型菜单
    /// </summary>
    public class Dtree
    {
        public DtreeStatus status { get; set; } = new DtreeStatus()
        {
            code = 200,
            message = "获取成功"
        };

        public dynamic data { get; set; }
    }

    public class DtreeStatus
    {
        public int code { get; set; }
        public string message { get; set; }
    }

    public class DtreeItem
    {
        public string id { get; set; }

        /// <summary>
        /// 标题
        /// </summary>
        public string title { get; set; }

        public string parentId { get; set; }
        public List<DtreeItem> children { get; set; } = new List<DtreeItem>();

        /// <summary>
        /// //是否最后一级节点（true：是，false：否，布尔值，非必填）
        /// </summary>
        public bool last { get; set; }
    }

    public class DtreeCheckItem
    {
        public string id { get; set; }

        /// <summary>
        /// 标题
        /// </summary>
        public string title { get; set; }

        public string parentId { get; set; }
        public List<DtreeCheckItem> children { get; set; } = new List<DtreeCheckItem>();

        /// <summary>
        /// //是否最后一级节点（true：是，false：否，布尔值，非必填）
        /// </summary>
        public bool last { get; set; }

        /// <summary>
        ///  checked: "checked", //是否选中（开启复选框，0-未选中，1-选中，2-半选。非必填）
        /// type: "type", //复选框标记（开启复选框，从0开始。非必填）
        /// </summary>
        public Dictionary<string, string> checkArr { get; set; } = new Dictionary<string, string>();
    }

    public class DtreeEntity
    {
        public string id { get; set; }

        public string name { get; set; }

        public string pid { get; set; }

        /// <summary>
        /// 排序，默认为0
        /// </summary>
        public int sort { get; set; } = 0;
    }
}